# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=ipcalc
pkgver=1.0.3
pkgrel=0
pkgdesc="A modern IPv4/IPv6 ipcalc tool, assisting in network calculations in command line and as a tool for scripts."
url="https://gitlab.com/ipcalc/ipcalc"
arch="all"
license="GPL-2.0-or-later"
depends="libmaxminddb"
makedepends="meson ninja libmaxminddb-dev ronn"
subpackages="$pkgname-doc"
source="https://gitlab.com/ipcalc/ipcalc/-/archive/$pkgver/ipcalc-$pkgver.tar.gz
disable-failing-tests.patch"

build() {
	abuild-meson \
		-Duse_maxminddb=enabled \
		-Duse_runtime_linking=enabled \
	. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
9f6415e68c75858cea404200dcaa6cbde9676fc48b01253bd30fad1b0c1f0cd3e6d9b1fbf78392bf8c2eb06d0c8b0220c5e7c519b8e29dde1694fd09c41038cb  ipcalc-1.0.3.tar.gz
6e25ed36fa788a1d6905e14b6e1ccc0f2da2d9763ea517d6cddecd5f0b32f39085629abd32310205e323e021c7a9a965650c405882d9cb82a3e58deddd7e4143  disable-failing-tests.patch
"
